<template>
    <div class="box">
      <div class="contents">
        <div class="infos">
          <div class="name">
            <div class="name-top">
              <div>
                <p>
                  <b>{{ goodsinfos.name }}</b>
                  <span class="green-box">新品</span>
                </p>
                <p class="little-size">全新晓龙8 | 5000万主摄</p>
              </div>
              <p class="price">
                到手价 <sup>￥</sup> <span>{{ goodsinfos.price }}</span
                >起
              </p>
            </div>
            <div class="name-bottom">
              <p class="vedio">
                <span class="iconfont icon-yousanjiao"></span>视频
              </p>
              <p class="jpg">图片</p>
            </div>
          </div>
          <div class="mortgage">
            <p>
              ￥<b>{{ Math.round(goodsinfos.price/0.8) }}</b>
            </p>
            <span>享受24期免息</span>
          </div>
          <div class="look">
            <p>
              <span class="orange">预计得440米金</span>
              <span class="red">门店赠品</span>
            </p>
            <p class="orange">查看</p>
          </div>
          <div class="limitTime">
            <img src="imgs/qianggou.png" alt="" />
          </div>
          <div class="new">
            <div>
              <p>
                <span class="iconfont icon-component"></span
                ><span>小米上新</span>
              </p>
              <h5>来这里发现属于你的新品</h5>
            </div>
            <em>></em>
          </div>
          <div class="text">
            <p class="titie">
              <b>Xiaomi 12</b> <span class="iconfont icon-shangchuan"></span>
            </p>
            <p>「新品热卖中!至高享24期分期免息，前5000名评论晒单返50元红包」</p>
            <p>[黄金尺寸] 69.9mm宽度, -手可握,爱不释手</p>
            <p>[性能跃升]全新- -代骁龙8移动平台</p>
            <p>[疾速影像] 5000万主摄,焦点时刻在线</p>
          </div>
        </div>

        <div class="parameters">
          <p class="title"><em class="iconfont icon-x_duibi"></em> 机型对比</p>
          <div class="parameters-boxs">
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
            <div class="parameters-box">
              <em class="iconfont icon-xingzhuang"></em>
              <h4>CPU</h4>
              <p>全新一代</p>
            </div>
          </div>
        </div>
        <div class="rank">
          <p>
            <em class="iconfont icon-jiangzhang"></em><span>排行榜</span>
            <b>【小米手机热销榜】第2名</b>
          </p>
          <i>></i>
        </div>
        <div class="bg-gray">
          <div class="changeNew">
            <div>
              <p>
                <b>以旧换新以旧换 </b><span class="gray">新至高补贴3888元</span>
              </p>
              <p>本机Redmi K3...换购新机最低仅需￥2371</p>
            </div>
            <span class="orange2">立即换新</span>
          </div>
          <div class="fenqi">
            <p>
              <b class="title">分期</b>
              <span class="orange">免息</span>低至183.29元x 24期
            </p>
            <i>></i>
          </div>
          <div class="checked">
            <div>
              <p><b class="title">已选</b>Xiaomi 12 12GB+ 256GB紫色x1</p>
              <span>可选增值服务</span>
            </div>
            <i>></i>
          </div>
          <div class="post">
            <div>
              <p>
                <b class="title">送至</b
                ><em class="iconfont icon-dingweixiao"></em> 西安市雁塔区
                <span>有现货</span>
              </p>
              <span>明天14点前付款,预计1月6日送达⑦</span>
            </div>
            <i>></i>
          </div>
          <div class="store">
            <div>
              <p>
                <b class="title">门店</b>门店小米之家陕西西安莲湖区
                西市城购物中心
                <span>库存紧张</span>
              </p>
              <p>可选增值服务</p>
              <p>到店自取<span>距离4.25km</span></p>
              <p>
                10:00-20:00
                <span class="greenbox"
                  ><em class="iconfont icon-weixin"></em>立即咨询</span
                >
              </p>
            </div>
            <i>></i>
          </div>
          <div class="serve">
            <b class="title">服务</b>
            <p>
              <span><em class="iconfont icon-kongxinduigou"></em>小米自营</span>
              <span><em class="iconfont icon-kongxinduigou"></em>到店自取</span>
              <span><em class="iconfont icon-kongxinduigou"></em>门店闪送</span>
              <span><em class="iconfont icon-kongxinduigou"></em>小米发货</span>
              <span
                ><em class="iconfont icon-kongxinduigou"></em
                >15天无理由退货</span
              >
            </p>
            <i>></i>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "GoodsDetailContent",
  components: {
   
  },
  data() {
    return {
      goodsinfos: "",
      goodsinfo: "",
      goods: "",
        show: false,
        price:"",
        name:""
        
    
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push("/Goods");
    },
    onClickRight() {},
    toShoppingCar() {
      this.$router.push("/Cart");
    },
    addShoppingCar() {
      this.show = true;
    },
    collection() {
      
    },
  },
  created() {
    console.log("this.$route", this.$route.query.id); //匹配到当前路由对象；
    axios({
      // url: "/goods?type1=" + this.$route.query.type,
      url: "/goods?id=" + this.$route.query.id,
    }).then((res) => {
      console.log(res.data);
      this.goodsinfos = res.data[0];
      // console.log(res.goodsinfos);
    });
    // axios({qianggou
    //   url: "/goods?type1=redmi&type4=show"
    // }).then((res) => {
    //   // console.log(res);
    //   this.goods = res.data;
    //  this.titleimg=this.goods[0].titleimg;
    //   console.log(this.goods[0].titleimg);
    // });
  },
};
</script>

<style scoped>
/* @import url(../../assets/iconfont2/iconfont.css); */
@import url(../../assets/iconfont2/iconfont.css);


.box {
  width: 100%;
  height: 100%;
  background-color: white;
  overflow-y: auto;
}

.contents {
  width: 100%;
  height: auto;
  padding-bottom: 0.55rem;
}
.contents .infos {
  width: 3.35rem;
  margin-left: 0.2rem;
  background-color: white;
}
.contents .name {
  width: 3.15rem;
  height: 0.9rem;
  background-color: #dfdfdf;
  border-radius: 0.1rem;
  padding: 0.1rem;
  margin-top: 0.1rem;
}
.contents .name-top {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  font-size: 0.1rem;
}
.contents .name-top b {
  font-size: 0.14rem;
}
.name-top .price {
  font-weight: 700;
}
.name-top .price span {
  font-size: 0.26rem;
  font-weight: 700;
}
.name-top .little-size {
  font-size: 10px;
  -webkit-transform: scale(0.8);
  margin-left: -0.12rem;
}
.name-top .green-box {
  background-color: #4fa893;
  color: white;
  border-radius: 0.05rem;
  padding: 0rem 0.02rem;
  -webkit-transform: scale(0.8);
}

.name-bottom {
  display: flex;
  justify-content: center;
  margin-top: 0.1rem;
}
.name-bottom p {
  padding: 0.03rem 0.1rem;
  border-radius: 0.1rem;
  margin-right: 0.1rem;
  font-size: 0.1rem;
}
.name-bottom .vedio {
  background-color: orange;
  color: white;
}
.name-bottom .jpg {
  background-color: white;
}

/* 按揭 */
.contents .mortgage {
  width: 3.35rem;
  height: 0.5rem;
  color: #fe5932;
  display: flex;
  justify-content: left;
  font-size: 0.14rem;
  align-items: center;
}
.contents .mortgage b {
  font-size: 0.22rem;
}
.contents .mortgage span {
  border: 1px solid orangered;
  font-size: 0.1rem;
  margin-left: 0.1rem;
  background-color: #feede5;
  border-radius: 0.04rem;
  padding: 0.02rem;
}
.limitTime {
  margin-top: 0.1rem;
}
.limitTime img {
  width: 3.35rem;
}

/* 查看 */
.contents .look {
  height: 0.25rem;
  display: flex;
  justify-content: space-between;
  background-color: #fff2ef;
  font-size: 0.1rem;
  border-radius: 0.04rem;
  align-items: center;
  padding: 0.05rem 0.1rem;
}
.orange {
  border: 1px solid orange;
  padding: 0.01rem 0.02rem;
  border-radius: 0.03rem;
  color: orange;
  margin-right: 0.05rem;
}
.look .red {
  border: 1px solid red;
  padding: 0.01rem 0.02rem;
  border-radius: 0.03rem;
  color: red;
}

.contents .new {
  display: flex;
  justify-content: space-between;
  height: 0.4rem;
  align-items: center;
  font-size: 0.12rem;
  background-color: white;
}
.contents .new div {
  display: flex;
}
.new p {
  background-color: #383838;
  color: #baad9c;
  padding: 0.03rem 0.08rem;
  border-radius: 0.1rem;
}
.new span {
  display: inline-block;
  height: 0.16rem;
  margin-right: 0.06rem;
  vertical-align: middle;
}
.new h5 {
  margin-top: 0.05rem;
  margin-left: 0.05rem;
}

.text {
  width: 100%;
  font-weight: 700;
  font-size: 0.12rem;
  background-color: white;
}
.text .titie {
  font-size: 0.16rem !important;
  display: flex;
  justify-content: space-between;
}
.text p {
  line-height: 0.22rem;
}

.contents .parameters {
  width: 100%;
  height: 1.4rem;
  background-color: white;
}
.parameters .title span {
  display: inline-block;
}
.parameters .title .iconfont {
  display: inline-block;
  width: 0.16rem;
  height: 0.16rem;
  border-radius: 0.16rem;
  padding: 0.03rem;
  margin-left: 0.04rem;
  background-color: black;
  color: white;
  font-size: 0.12rem;
}

.icon-x_duibi:before {
  margin-left: 2px;
  vertical-align: middle;
}
.parameters .title {
  padding: 0.1rem 0.15rem;
  font-size: 0.14rem;
  font-weight: 700;
  border-bottom: 1px solid lightgray;
}
.parameters-boxs {
  border-top: 2px solid e5e5e5;
  padding: 0.1rem;
  display: flex;
  white-space: nowrap;
  overflow-x: auto;
}
.parameters-box {
  height: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;

  text-align: center;
  padding: 0.05rem 0.12rem;
}
.parameters-box h4 {
  font-size: 0.12rem;
}
.parameters-box p {
  font-size: 0.1rem;
}
.bg-gray {
  background-color: #f6f6f6;
}

.contents .rank {
  height: 0.5rem;
  background-color: #fff3eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
}
.contents .rank span {
  font-weight: 900;
}
.contents .rank .iconfont {
  color: orangered;
  font-size: 0.2rem;

  margin-right: 0.05rem;
}
.contents .changeNew {
  height: 0.45rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  font-size: 0.12rem;
  font-weight: 700;
  margin-top: 0.1rem;
  background-color: white;
}
.changeNew b {
  color: #ff4118;
}
.changeNew .gray {
  color: gray;
  font-size: 0.1rem;
}
.changeNew .orange2 {
  padding: 0.03rem 0.1rem;
  border-radius: 0.1rem;
  margin-right: 0.1rem;
  font-size: 0.1rem;
  background-color: #fe7212;
  color: white;
}
.contents .fenqi,
.checked,
.post,
.store,
.serve {
  height: 0.62rem;
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
  font-size: 0.14rem;
  font-weight: 700;
}
.fenqi .orange {
  font-size: 0.1rem;
  -webkit-transform: scale(0.8);
}
.contents .bg-gray i {
  font-weight: 500;
  font-size: 0.2rem;
}
.bg-gray .title {
  margin-right: 0.15rem;
  white-space: nowrap;
}
.contents .checked {
  height: 0.62rem;
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
}
.contents .post {
  height: 0.62rem;
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
}
.contents .store {
  height: 1.05rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
}
.store .iconfont {
  color: green;
  vertical-align: middle;
}
.store .greenbox {
  padding: 0.01rem 0.02rem;
  border: 1px solid green;
  border-radius: 0.1rem;
  color: green;
  font-size: 0.1rem;
}
.contents .serve {
  height: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.15rem;
  margin-top: 0.1rem;
}
.serve span {
  color: gray;
  font-size: 0.1rem;
  margin-right: 0.12rem;
  height: 0.16rem;
}
.serve .iconfont {
  font-size: 0.1rem;
}
</style>
